// Author: Wang Hsutung

#include "Triangle.h"
#include <cmath>

Triangle::Triangle()
{
	a = b = c = 0;
}

Triangle::Triangle(double x, double y, double z)
{
	a = x;
	b = y;
	c = z;
}

double Triangle::Area()
{
	double p = (a + b + c) / 2;
	return std::sqrt(p * (p - a) * (p - b) * (p - c));
}

bool operator>(Triangle a, Triangle b)
{
	return a.Area() > b.Area();
}

bool operator<(Triangle a, Triangle b)
{
	return a.Area() < b.Area();
}

bool operator==(Triangle a, Triangle b)
{
	return a.Area() == b.Area();
}

bool operator!=(Triangle a, Triangle b)
{
	return a.Area() != b.Area();
}
